<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>菜单列表</title>
  <link rel="stylesheet" href="./css/style.css" />
</head>

<body>
  <h3 class="big-tit">菜谱列表</h3>
  <ul class="list-box">
    <!-- <li>
      <a href="info.html">
        <img src="http://yun.itheima.com/Upload/Images/20220627/62b924298e658.jpg" alt="" />
        <h3>菜单名称</h3>
      </a>
    </li>
    <li>
      <a href="info.html">
        <img src="http://yun.itheima.com/Upload/Images/20220627/62b924298e658.jpg" alt="" />
        <h3>菜单名称</h3>
      </a>
    </li>
    <li>
      <a href="info.html">
        <img src="http://yun.itheima.com/Upload/Images/20220627/62b924298e658.jpg" alt="" />
        <h3>菜单名称</h3>
      </a>
    </li>
    <li>
      <a href="info.html">
        <img src="http://yun.itheima.com/Upload/Images/20220627/62b924298e658.jpg" alt="" />
        <h3>菜单名称</h3>
      </a>
    </li>
    <li>
      <a href="info.html">
        <img src="http://yun.itheima.com/Upload/Images/20220627/62b924298e658.jpg" alt="" />
        <h3>菜单名称</h3>
      </a>
    </li>
    <li>
      <a href="info.html">
        <img src="http://yun.itheima.com/Upload/Images/20220627/62b924298e658.jpg" alt="" />
        <h3>菜单名称</h3>
      </a>
    </li>
    <li>
      <a href="info.html">
        <img src="http://yun.itheima.com/Upload/Images/20220627/62b924298e658.jpg" alt="" />
        <h3>菜单名称</h3>
      </a>
    </li>
    <li>
      <a href="info.html">
        <img src="http://yun.itheima.com/Upload/Images/20220627/62b924298e658.jpg" alt="" />
        <h3>菜单名称</h3>
      </a>
    </li> -->
  </ul>
  <!-- <p class="more">数据正在加载中...</p> -->
  <p class="noinfo">没有数据了...</p>
  <script src="../jquery.min.js"></script>
  <script src="./tongyi.js"></script>
  <script src="../axios.js"></script>
  <script>
    $(function () {
      fun()
      async function fun() {
        const { data: { data } } = await axios({
          url: '/recipe',
          method: 'GET',
          params: {
            pageNum: 1,
            pageSize: 30,
          }
        })
        const pop = data.list.map((ele) => `
    <li>
      <a href="info.html?id=${ele.id}">
        <img src=" http://124.223.14.236:3001/public/${ele.img}" alt="" />
        <h3>${ele.name}</h3>
      </a>
    </li>
    `).join('')
        $('.list-box').html(pop)
      }
    })
  </script>
</body>

</html>